//
//  StrategyModel.m
//  NewNest
//
//  Created by 王阳阳 on 16/3/9.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "StrategyModel.h"

@implementation StrategyModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        self.detailId = value;
    }else if ([key isEqualToString:@"description"]) {
        self.content = value;
    }
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_title forKey:@"title"];
    [aCoder encodeObject:_content forKey:@"content"];
    [aCoder encodeObject:_covorPhotoId forKey:@"covorPhotoId"];
    [aCoder encodeObject:_detailId forKey:@"detailId"];
    [aCoder encodeObject:_categoryName forKey:@"category"];
    [aCoder encodeObject:_likeCount forKey:@"likeCount"];
    [aCoder encodeObject:_commentCount forKey:@"commentCount"];
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.content = [aDecoder decodeObjectForKey:@"content"];
        self.covorPhotoId = [aDecoder decodeObjectForKey:@"covorPhotoId"];
        self.detailId = [aDecoder decodeObjectForKey:@"detailId"];
        self.categoryName = [aDecoder decodeObjectForKey:@"category"];
        self.likeCount = [aDecoder decodeObjectForKey:@"likeCount"];
        self.commentCount = [aDecoder decodeObjectForKey:@"commentCount"];
    }
    return self;
}


@end
